import {Component, EventEmitter, OnInit, Output} from '@angular/core';
import {Router} from '@angular/router';

@Component({
  selector: 'app-header',
  templateUrl: './header.component.html',
  styleUrls: ['./header.component.scss']
})
export class HeaderComponent implements OnInit {
  @Output()
  toggle = new EventEmitter<void>();
  @Output()
  toggleTheme = new EventEmitter<boolean>();

  constructor(private router: Router) { }

  ngOnInit() {
  }
  // 切换打开sidebar
  openSideBar() {
    this.toggle.emit();
  }
  // 切换slideToggle
  onSlideToggleChange(event: any) {
    this.toggleTheme.emit(event.checked);
  }
  test() {
    this.router.navigate(['/login']);
  }
}
